﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EM.OA.DataModel
{
    /// <summary> 对应数据库中的主键</summary>
    public class PrimaryKey : Attribute
    {
    }

    /// <summary>自增长ID</summary>
    public class Identity : Attribute
    {
    }

    /// <summary> 对应数据库中的外键</summary>
    public class ForeignKey : Attribute
    {
    }

    /// <summary> </summary>
    public class DisableFilter : Attribute
    { }

    /// <summary></summary>
    public class UniqueCheck : Attribute
    { }

    /// <summary> </summary>
    public class ParentFiled : Attribute
    { }

    /// <summary>不是表的真实字段</summary>
    public class Ignore : Attribute
    { }

    /// <summary>对应数据库中表的名称 </summary>
    public class TableName : Attribute
    {
        string name = string.Empty;
        public TableName(string tableName)
        {
            name = tableName;
        }

        /// <summary>Gets the name.</summary>
        public string Name
        {
            get { return name; }
        }

        protected void ResetName(string name)
        {
            this.name = name;
        }
    }

    /// <summary> 外键依赖表 </summary>
    public class ReferenceTableName : Attribute
    {
        private string _name = string.Empty;

        public ReferenceTableName(string tableName)
        {
            this._name = tableName;
        }

        public string Name
        {
            get
            {
                return this._name;
            }
        }
    }

    /// <summary></summary>
    public class Length : Attribute
    {
        int fieldLenth = 0;
        public Length(int length)
        {
            fieldLenth = length;
        }

        public int FieldLength
        {
            get { return fieldLenth; }
        }
    }
}
